import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../../../../services/screebAdapter.dart';
import '../controllers/address_list_controller.dart';

class AddressListView extends GetView<AddressListController> {
  const AddressListView({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color.fromRGBO(247, 247, 247, 1),
      appBar: AppBar(
        title: const Text('收货地址'),
        centerTitle: true,
        backgroundColor: Colors.white,
        elevation: 0,
      ),
      body: Stack(
        children: [
          Container(
            padding: EdgeInsets.only(
              top: ScreenAdapter.width(30),
              bottom: ScreenAdapter.width(200),
              left: ScreenAdapter.width(30),
              right: ScreenAdapter.width(30),
            ),
            width: double.infinity,
            height: double.infinity,
            child: Container(
              width: double.infinity,
              height: double.infinity,
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(ScreenAdapter.width(40))),
              child: ListView(
                children: [
                  Container(
                    padding: EdgeInsets.all(ScreenAdapter.width(40)),
                    decoration: BoxDecoration(
                        border: Border(
                            bottom: BorderSide(
                                color: Colors.black12,
                                width: ScreenAdapter.width(1)),
                            top: BorderSide(
                                color: Colors.black12,
                                width: ScreenAdapter.width(1)))),
                    child: ListTile(
                      title: Column(
                        children: [
                          Container(
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '北京市 海淀区',
                              style: TextStyle(
                                  fontSize: ScreenAdapter.fontSize(30),
                                  color: Colors.black45),
                            ),
                          ),
                          Container(
                            alignment: Alignment.centerLeft,
                            margin: EdgeInsets.only(
                                bottom: ScreenAdapter.height(10),
                                top: ScreenAdapter.height(10)),
                            child: Text(
                              '西二旗街道',
                              style: TextStyle(
                                  fontSize: ScreenAdapter.fontSize(40),
                                  fontWeight: FontWeight.bold),
                            ),
                          ),
                          Row(
                            children: [
                              Container(
                                padding: EdgeInsets.only(
                                    right: ScreenAdapter.width(20)),
                                child: Text(
                                  '张三',
                                  style: TextStyle(
                                      fontSize: ScreenAdapter.fontSize(34)),
                                ),
                              ),
                              Text(
                                '155216821234',
                                style: TextStyle(
                                    fontSize: ScreenAdapter.fontSize(26),
                                    color: Colors.black26),
                              )
                            ],
                          ),
                        ],
                      ),
                      trailing: Icon(
                        Icons.edit_outlined,
                        color: Colors.black,
                        size: ScreenAdapter.fontSize(50),
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
          Positioned(
              bottom: 0,
              left: 0,
              right: 0,
              child: Container(
                alignment: Alignment.center,
                padding: EdgeInsets.only(
                    left: ScreenAdapter.width(20),
                    right: ScreenAdapter.width(20)),
                width: ScreenAdapter.width(1080),
                height: ScreenAdapter.height(190),
                color: Colors.white,
                child: InkWell(
                  onTap: () {
                    Get.toNamed('/address-adRqd');
                  },
                  child: Container(
                      alignment: Alignment.center,
                      width: ScreenAdapter.width(1000),
                      height: ScreenAdapter.height(120),
                      color: const Color.fromRGBO(255, 102, 0, 1),
                      child: Text(
                        '新建收货地址',
                        style: TextStyle(
                            color: Colors.white,
                            fontSize: ScreenAdapter.fontSize(50)),
                      )),
                ),
              ))
        ],
      ),
    );
  }
}
